<!--
 * @Author: lirl
 * @Date: 2022-07-18 10:15:53
 * @Description: 待阅列表
-->
<template>
  <biz-workbench-task-list :get-function="getFunction" :columns="columns" show-index @openTaskForm="openTaskForm">
  </biz-workbench-task-list>
</template>
<script>
import { timeConvert } from 'jdf-util';
import { WorkService } from 'jdf-jssdk';
import { bizServiceURL } from '@/api/utils/constants';
import routerJump from '@/api/utils/router-jump';

export default {
  data() {
    return {
      openTaskForm: routerJump.openTaskForm,
      columns: [
        {
          prop: 'title',
          label: '标题',
          attrs: {
            'show-overflow-tooltip': true,
            minWidth: 200,
          },
        },
        {
          prop: 'processDefinitionName',
          width: 160,
          label: '文种',
          attrs: {
            'show-overflow-tooltip': true,
          }
        },
        {
          prop: 'nodeName',
          width: 150,
          label: '当前环节',
          attrs: {
            'show-overflow-tooltip': true,
          }
        },
        {
          prop: 'receiverName',
          width: 150,
          label: '当前环节处理人',
          attrs: {
            align: 'center'
          }
        },
        {
          prop: 'createTime',
          label: '创建时间',
          width: 180,
          attrs: {
            align: 'center',
            formatter: (row) => timeConvert(row.createTime, 'YYYY-MM-DD HH:mm:ss'),
          }
        }
      ]
    };
  },
  methods: {
    getFunction(params) {
      return new WorkService(bizServiceURL).getToreadList(params);
    }
  }
};
</script>
